<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/1.8.0/jquery.min.js"></script>
    <script type="text/javascript" src="js/linkage-menu.js"></script>
    <link rel="stylesheet" type="text/css" href="js/linkage-menu.css" />
    <script>
        /**
         * url：滑动到对应节点后请求同级节点的地址，get请求，参数key=linkage-key
         * method：可选
         * callback:点击二级节点回调函数，参数key为Url响应的key，text为响应的text
         */
        $(function(){
            $("#test").linkageMenu({
                url:"json.txt",
                urlParents:"parent.txt",
                method:"GET",
                callback:function(key,text){
                    alert("点击的元素key为"+key+",文本为"+text);
                }
            });
        });
    </script>
</head>
<body>
    <div id="test">
        <div linkage-key="3" linkage-text="测试3"></div>
    </div>
    <div>数据量</div>
</body>
</html>